package com.yuw.oop.polymorphicdemo4;

public class Dog extends Animal {

	/**
	 * 进食行为
	 */
	public void doEating() {
		System.out.println(this.getAnimalName() + " is eating bone...");
		// 可以通过super调用父类的属性和行为方法
		System.out.println("父类原始的吃饭方式：");
		super.doEating();
	}

	
	
	
	@Override
	public void doSleeping() {		
		super.doSleeping();
		
	}




	/**
	 * 抓老鼠的行为
	 */
	public void doCatching() {
		System.out.println(this.getAnimalName() + " catched a Jerry...");
		super.doEating();
		doEating();
	}
}
